<?php
declare (strict_types = 1);

namespace app\admin\controller;
use app\common\controller\AdminController;
use app\common\service\AuthService;
use app\common\service\system\MenuService;
use hg\apidoc\annotation as Apidoc;
use think\facade\Db;

/**
 * @Apidoc\Title("基础示例")
 */
class Index extends AdminController
{
    /**
     * @Apidoc\Title("基础的注释方法")
     * @Apidoc\Desc("最基础的接口注释写法")
     * @Apidoc\Method("GET")
     * @Apidoc\Author("HG-CODE")
     * @Apidoc\Tag("测试")
     * @Apidoc\Param("username", type="abc",require=true, desc="用户名")
     * @Apidoc\Param("password", type="string",require=true, desc="密码")
     * @Apidoc\Param("phone", type="string",require=true, desc="手机号")
     * @Apidoc\Param("sex", type="int",default="1",desc="性别" )
     * @Apidoc\Returned("id", type="int", desc="用户id")
     */
    public function index()
    {
        $tree = app(MenuService::class)->getTree(1);
        return success($tree);
    }

}
